
package com.clarence.dada.modular.system.menu.entity.resp;

import com.clarence.dada.core.tree.base.AbstractTreeNode;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * 菜单树节点，用在新增和修改菜单，下拉选父级时候
 *
 * @author GD
 * @date 2020/4/5 12:03
 */
@Data
@Schema(description = "系统菜单下拉树节点响应实例")
public class SysMenuDropDownTreeResp implements AbstractTreeNode<SysMenuDropDownTreeResp> {

    /**
     * 主键
     */
    @Schema(title = "主键", example = "1")
    private Long id;

    /**
     * 父id
     */
    @Schema(title = "父id", example = "-1")
    private Long parentId;

    /**
     * 名称
     */
    @Schema(title = "名称", example = "菜单")
    private String title;

    /**
     * 值
     */
    @Schema(title = "值", example = "menu")
    private String value;

    /**
     * 排序，越小优先级越高
     */
    @Schema(title = "排序，越小优先级越高", example = "10")
    private BigDecimal weight;

    /**
     * 子节点
     */
    @Schema(title = "子节点", example = "子节点信息")
    private List<SysMenuDropDownTreeResp> children;

    @Override
    public String getNodeId() {
        return id.toString();
    }

    @Override
    public String getNodeParentId() {
        return this.parentId.toString();
    }

    @Override
    public void setChildrenNodes(List<SysMenuDropDownTreeResp> childrenNodes) {
        this.children = childrenNodes;
    }
}
